//该文件专门用于创建整个应用的路由
import VueRouter from "vue-router";

//引入组件
import login from '../pages/Login'

import individualCenter from '../pages/individualCenter'
import chat from '../pages/chat'
import postHelp from '../pages/postHelp'
import accountBalance from '../pages/accountBalance'
import assistManagement from '../pages/assistManagement'
import helpManagement from '../pages/helpManagement'
import personalDetails from '../pages/personalDetails'
import verify from '../pages/verify'
import finished from '../pages/finished'
import helpDetail from '@/pages/helpDetail.vue'
// import test from '@/pages/test.vue'
import helpHall from '@/pages/helpHall.vue'






//创建并暴露一个路由器

export default new VueRouter({
    routes: [{
            path: '/',
            redirect: '/home'
        },
        {
            name: 'home',
            path: '/home',
            component: helpHall,
            meta: {
                title: "首页"
            }
        },
        {
            name: 'helpHall',
            path: '/helpHall',
            component: helpHall,
            meta: {
                title: "求助大厅"
            }
        }, {
            name: 'login',
            path: '/login',
            component: login,
        }, {
            name: 'postHelp',
            path: '/postHelp',
            component: postHelp,
            meta: {
                title: "发布求助"
            }
        },
        {
            name: 'center',
            path: '/center',
            component: individualCenter,
            meta: {
                title: "个人中心"
            },
            children: [

                {
                    name: 'accountBalance',
                    path: 'accountBalance',
                    component: accountBalance,
                    meta: {
                        title: "我的余额"
                    }
                },
                {
                    name: 'assistManagement',
                    path: 'assistManagement',
                    component: assistManagement,
                    meta: {
                        title: "协助管理"
                    }
                },
                {
                    name: 'helpManagement',
                    path: 'helpManagement',
                    component: helpManagement,
                    meta: {
                        title: "求助管理"
                    }
                },
                {
                    name: 'personalInfo',
                    path: 'personalInfo',
                    component: personalDetails,
                    meta: {
                        title: "个人信息"
                    }
                },
                {
                    name: 'verify',
                    path: 'verify',
                    component: verify,
                    meta: {
                        title: "订单审核"
                    }
                }, {
                    name: 'finished',
                    path: 'finished',
                    component: finished,
                    meta: {
                        title: "完成任务"
                    }
                }
            ],
            // redirect: '/center/personalInfo'
        },
        {
            name: 'chat',
            path: '/chat',
            component: chat,
            meta: {
                title: "聊天"
            }

        }, {

            name: "helpDetail",
            path: "/helpDetail",
            component: helpDetail,
            meta: {
                title: "求助详情"
            }
        }
    ]

})